home *** CD-ROM | disk | FTP | other *** search
- Path: news.mira.net.au!usenet
- From: tsi@werple.mira.net.au (Paul Thomson)
- Newsgroups: comp.lang.c++
- Subject: BC5.0 and Templates
- Date: 12 Apr 1996 08:05:57 GMT
- Organization: Thomson Scientific Instruments
- Message-ID: <4kl2t5$cp@eplet.mira.net.au>
- NNTP-Posting-Host: dp-m-b41.werple.net.au
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.14
-
- I am in the unfortunate position at the moment of having to work on some elses code. I am having
- difficulty getting some code which compiles fine on BC4.53 to compile using BC5.0. The problem
- concerns templates with which I am not very familair. The following code is not functional but
- does compile using BC4.53:
-
- FOOTEST.H
-
- #ifndef Foo_H
- #define Foo_H
-
- template<class T> class foo {
- public:
- foo(int size = 0);
- };
-
- #endif
-
- FOOTEST.CPP
-
- #include "footest.h"
-
- foo<double>::foo(int sz) {
- }
-
- template<class T> foo<T>::foo(int size) {
- }
-
- BC5.0 complains that "Body has already been defined for function 'foo<double>::foo<int>'
-
- Is this legal C++? Was there a bug in BC4.53 which allowed this or does BC5.0 indeed have a bug
- in this area?
-
-
- Regards,
-
-
- Paul Thomson
-
-
-
-
-
-